package com.exam.service;

import com.exam.entity.*;
import com.exam.mss.*;
import com.exam.mysql.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import java.util.List;

@Service
public class TransferMSS2MySqlService {

    @Autowired
    private ExExamMapper exExamMapper;
    @Autowired
    private ExExamDao exExamDao;

    public List<ExExam> getExExam(int pageNo,int pageSize){
        PageInfo<ExExam> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("ExamId")
                .doSelectPageInfo(() -> exExamMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferExExam(List<ExExam> histories){
        exExamDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private ExPaperMapper exPaperMapper;
    @Autowired
    private ExPaperDao exPaperDao;

    public List<ExPaper> getExPaper(int pageNo, int pageSize){
        PageInfo<ExPaper> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("PaperId")
                .doSelectPageInfo(() -> exPaperMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferExPaper(List<ExPaper> histories){
        exPaperDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private ExSenicSpotMapper exSenicSpotMapper;
    @Autowired
    private ExSenicSpotDao exSenicSpotDao;

    public List<ExSenicSpot> getExSenicSpot(int pageNo, int pageSize){
        PageInfo<ExSenicSpot> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("SenicId")
                .doSelectPageInfo(() -> exSenicSpotMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferExSenicSpot(List<ExSenicSpot> histories){
        exSenicSpotDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private ExUserExamMapper exUserExamMapper;
    @Autowired
    private ExUserExamDao exUserExamDao;

    public List<ExUserExam> getExUserExam(int pageNo, int pageSize){
        PageInfo<ExUserExam> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("UEId")
                .doSelectPageInfo(() -> exUserExamMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferExUserExam(List<ExUserExam> histories){
        exUserExamDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private ExUserPaperHistoryMapper exUserPaperHistoryMapper;
    @Autowired
    private ExUserPaperHistoryDao exUserPaperHistoryDao;

    public List<ExUserPaperHistory> getExUserPaperHistory(int pageNo, int pageSize){
        PageInfo<ExUserPaperHistory> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("UPId")
                .doSelectPageInfo(() -> exUserPaperHistoryMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferExUserPaperHistory(List<ExUserPaperHistory> histories){
        exUserPaperHistoryDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private ExUserSenicSpotMapper exUserSenicSpotMapper;
    @Autowired
    private ExUserSenicSpotDao exUserSenicSpotDao;

    public List<ExUserSenicSpot> getExUserSenicSpot(int pageNo, int pageSize){
        PageInfo<ExUserSenicSpot> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("USId")
                .doSelectPageInfo(() -> exUserSenicSpotMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferExUserSenicSpot(List<ExUserSenicSpot> histories){
        exUserSenicSpotDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysAnswerHistoryMapper sysAnswerHistoryMapper;
    @Autowired
    private SysAnswerHistoryDao sysAnswerHistoryDao;

    public List<SysAnswerHistory> getSysAnswerHistory(int pageNo,int pageSize){
        PageInfo<SysAnswerHistory> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("HistoryId")
                .doSelectPageInfo(() -> sysAnswerHistoryMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysAnswerHistory(List<SysAnswerHistory> histories){
        sysAnswerHistoryDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysAppVersionsMapper sysAppVersionsMapper;
    @Autowired
    private SysAppVersionsDao sysAppVersionsDao;

    public List<SysAppVersions> getSysAppVersions(int pageNo, int pageSize){
        PageInfo<SysAppVersions> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("Id")
                .doSelectPageInfo(() -> sysAppVersionsMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysAppVersions(List<SysAppVersions> histories){
        sysAppVersionsDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysChapterMapper sysChapterMapper;
    @Autowired
    private SysChapterDao sysChapterDao;

    public List<SysChapter> getSysChapter(int pageNo, int pageSize){
        PageInfo<SysChapter> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("ChapterId")
                .doSelectPageInfo(() -> sysChapterMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysChapter(List<SysChapter> histories){
        sysChapterDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysChinaProviceInfoMapper sysChinaProviceInfoMapper;
    @Autowired
    private SysChinaProviceInfoDao sysChinaProviceInfoDao;

    public List<SysChinaProviceInfo> getSysChinaProviceInfo(int pageNo, int pageSize){
        PageInfo<SysChinaProviceInfo> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("ProviceId")
                .doSelectPageInfo(() -> sysChinaProviceInfoMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysChinaProviceInfo(List<SysChinaProviceInfo> histories){
        sysChinaProviceInfoDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysColQueMapper sysColQueMapper;
    @Autowired
    private SysColQueDao sysColQueDao;

    public List<SysColQue> getSysColQue(int pageNo, int pageSize){
        PageInfo<SysColQue> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("ColQueId")
                .doSelectPageInfo(() -> sysColQueMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysColQue(List<SysColQue> histories){
        sysColQueDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysCourseMapper sysCourseMapper;
    @Autowired
    private SysCourseDao sysCourseDao;

    public List<SysCourse> getSysCourse(int pageNo, int pageSize){
        PageInfo<SysCourse> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("CourseId")
                .doSelectPageInfo(() -> sysCourseMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysCourse(List<SysCourse> histories){
        sysCourseDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysCourseMajorMapMapper sysCourseMajorMapMapper;
    @Autowired
    private SysCourseMajorMapDao sysCourseMajorMapDao;

    public List<SysCourseMajorMapKey> getSysCourseMajorMapKey(int pageNo, int pageSize){
        PageInfo<SysCourseMajorMapKey> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("MajorId,CourseId")
                .doSelectPageInfo(() -> sysCourseMajorMapMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysCourseMajorMapKey(List<SysCourseMajorMapKey> histories){
        if (CollectionUtils.isEmpty(histories)){
            return 0;
        }
        sysCourseMajorMapDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysErrorMapper sysErrorMapper;
    @Autowired
    private SysErrorDao sysErrorDao;

    public List<SysError> getSysError(int pageNo, int pageSize){
        PageInfo<SysError> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("ErrorId")
                .doSelectPageInfo(() -> sysErrorMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysError(List<SysError> histories){
        sysErrorDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysExperimentMapper sysExperimentMapper;
    @Autowired
    private SysExperimentDao sysExperimentDao;

    public List<SysExperiment> getSysExperiment(int pageNo, int pageSize){
        PageInfo<SysExperiment> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("ExpId")
                .doSelectPageInfo(() -> sysExperimentMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysExperiment(List<SysExperiment> histories){
        if (CollectionUtils.isEmpty(histories)){
            return 0;
        }
        sysExperimentDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysLogMapper sysLogMapper;
    @Autowired
    private SysLogDao sysLogDao;

    public List<SysLog> getSysLog(int pageNo, int pageSize){
        PageInfo<SysLog> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("LogId")
                .doSelectPageInfo(() -> sysLogMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysLog(List<SysLog> histories){
        sysLogDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysMajorMapper sysMajorMapper;
    @Autowired
    private SysMajorDao sysMajorDao;

    public List<SysMajor> getSysMajor(int pageNo, int pageSize){
        PageInfo<SysMajor> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("MajorId")
                .doSelectPageInfo(() -> sysMajorMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysMajor(List<SysMajor> histories){
        if (CollectionUtils.isEmpty(histories)){
            return 0;
        }
        sysMajorDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysMenuMapper sysMenuMapper;
    @Autowired
    private SysMenuDao sysMenuDao;

    public List<SysMenu> getSysMenu(int pageNo, int pageSize){
        PageInfo<SysMenu> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("MenuId")
                .doSelectPageInfo(() -> sysMenuMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysMenu(List<SysMenu> histories){
        sysMenuDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysNoticeMapper sysNoticeMapper;
    @Autowired
    private SysNoticeDao sysNoticeDao;

    public List<SysNotice> getSysNotice(int pageNo, int pageSize){
        PageInfo<SysNotice> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("NoticeId")
                .doSelectPageInfo(() -> sysNoticeMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysNotice(List<SysNotice> histories){
        sysNoticeDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysOrganizeMapper sysOrganizeMapper;
    @Autowired
    private SysOrganizeDao sysOrganizeDao;

    public List<SysOrganize> getSysOrganize(int pageNo, int pageSize){
        PageInfo<SysOrganize> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("OrganizeCode")
                .doSelectPageInfo(() -> sysOrganizeMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysOrganize(List<SysOrganize> histories){
        sysOrganizeDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysParameterMapper sysParameterMapper;
    @Autowired
    private SysParameterDao sysParameterDao;

    public List<SysParameter> getSysParameter(int pageNo, int pageSize){
        PageInfo<SysParameter> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("Id")
                .doSelectPageInfo(() -> sysParameterMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysParameter(List<SysParameter> histories){
        sysParameterDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysPropertyMapper sysPropertyMapper;
    @Autowired
    private SysPropertyDao sysPropertyDao;

    public List<SysProperty> getSysProperty(int pageNo, int pageSize){
        PageInfo<SysProperty> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("Key,Value")
                .doSelectPageInfo(() -> sysPropertyMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysProperty(List<SysProperty> histories){
        if (CollectionUtils.isEmpty(histories)){
            return 0;
        }
        sysPropertyDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysQueBankMapMapper sysQueBankMapMapper;
    @Autowired
    private SysQueBankMapDao sysQueBankMapDao;

    public List<SysQueBankMapKey> getSysQueBankMap(int pageNo, int pageSize){
        PageInfo<SysQueBankMapKey> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("QueId,QueBankId")
                .doSelectPageInfo(() -> sysQueBankMapMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysQueBankMap(List<SysQueBankMapKey> histories){
        if (CollectionUtils.isEmpty(histories)){
            return 0;
        }
        sysQueBankMapDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysQueBankSubMapMapper sysQueBankSubMapMapper;
    @Autowired
    private SysQueBankSubMapDao sysQueBankSubMapDao;

    public List<SysQueBankSubMapKey> getSysQueBankSubMap(int pageNo, int pageSize){
        PageInfo<SysQueBankSubMapKey> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("QueBankId,SubId")
                .doSelectPageInfo(() -> sysQueBankSubMapMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysQueBankSubMap(List<SysQueBankSubMapKey> histories){
        sysQueBankSubMapDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysQuestionMapper sysQuestionMapper;
    @Autowired
    private SysQuestionDao sysQuestionDao;

    public List<SysQuestion> getSysQuestion(int pageNo, int pageSize){
        PageInfo<SysQuestion> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("QueId")
                .doSelectPageInfo(() -> sysQuestionMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysQuestion(List<SysQuestion> histories){
        sysQuestionDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysQuestionBankMapper sysQuestionBankMapper;
    @Autowired
    private SysQuestionBankDao sysQuestionBankDao;

    public List<SysQuestionBank> getSysQuestionBank(int pageNo, int pageSize){
        PageInfo<SysQuestionBank> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("QueBankId")
                .doSelectPageInfo(() -> sysQuestionBankMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysQuestionBank(List<SysQuestionBank> histories){
        sysQuestionBankDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysQuestionOptionsMapper sysQuestionOptionsMapper;
    @Autowired
    private SysQuestionOptionsDao sysQuestionOptionsDao;

    public List<SysQuestionOptions> getSysQuestionOptions(int pageNo, int pageSize){
        PageInfo<SysQuestionOptions> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("OptionId")
                .doSelectPageInfo(() -> sysQuestionOptionsMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysQuestionOptions(List<SysQuestionOptions> histories){
        sysQuestionOptionsDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysQuestionTypeMapper sysQuestionTypeMapper;
    @Autowired
    private SysQuestionTypeDao sysQuestionTypeDao;

    public List<SysQuestionType> getSysQuestionType(int pageNo, int pageSize){
        PageInfo<SysQuestionType> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("QusTypeId")
                .doSelectPageInfo(() -> sysQuestionTypeMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysQuestionType(List<SysQuestionType> histories){
        sysQuestionTypeDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysResourceMapper sysResourceMapper;
    @Autowired
    private SysResourceDao sysResourceDao;

    public List<SysResource> getSysResource(int pageNo, int pageSize){
        PageInfo<SysResource> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("ResourceId")
                .doSelectPageInfo(() -> sysResourceMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysResource(List<SysResource> histories){
        sysResourceDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysResourceNoteMapper sysResourceNoteMapper;
    @Autowired
    private SysResourceNoteDao sysResourceNoteDao;

    public List<SysResourceNote> getSysResourceNote(int pageNo, int pageSize){
        PageInfo<SysResourceNote> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("NoteId")
                .doSelectPageInfo(() -> sysResourceNoteMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysResourceNote(List<SysResourceNote> histories){
        sysResourceNoteDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysRoleMapper sysRoleMapper;
    @Autowired
    private SysRoleDao sysRoleDao;

    public List<SysRole> getSysRole(int pageNo, int pageSize){
        PageInfo<SysRole> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("RoleId")
                .doSelectPageInfo(() -> sysRoleMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysRole(List<SysRole> histories){
        sysRoleDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysRoleMenuMapMapper sysRoleMenuMapMapper;
    @Autowired
    private SysRoleMenuMapDao sysRoleMenuMapDao;

    public List<SysRoleMenuMap> getSysRoleMenuMap(int pageNo, int pageSize){
        PageInfo<SysRoleMenuMap> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("RoleId,MenuId")
                .doSelectPageInfo(() -> sysRoleMenuMapMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysRoleMenuMap(List<SysRoleMenuMap> histories){
        sysRoleMenuMapDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysSetupMapper sysSetupMapper;
    @Autowired
    private SysSetupDao sysSetupDao;

    public List<SysSetup> getSysSetup(int pageNo, int pageSize){
        PageInfo<SysSetup> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("SetupId")
                .doSelectPageInfo(() -> sysSetupMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysSetup(List<SysSetup> histories){
        sysSetupDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysSubjectMapper sysSubjectMapper;
    @Autowired
    private SysSubjectDao sysSubjectDao;

    public List<SysSubject> getSysSubject(int pageNo, int pageSize){
        PageInfo<SysSubject> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("SubId")
                .doSelectPageInfo(() -> sysSubjectMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysSubject(List<SysSubject> histories){
        sysSubjectDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysUserMapper sysUserMapper;
    @Autowired
    private SysUserDao sysUserDao;

    public List<SysUser> getSysUser(int pageNo, int pageSize){
        PageInfo<SysUser> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("UserId")
                .doSelectPageInfo(() -> sysUserMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysUser(List<SysUser> histories){
        sysUserDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysUserNoticeMapper sysUserNoticeMapper;
    @Autowired
    private SysUserNoticeDao sysUserNoticeDao;

    public List<SysUserNotice> getSysUserNotice(int pageNo, int pageSize){
        PageInfo<SysUserNotice> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("UNId")
                .doSelectPageInfo(() -> sysUserNoticeMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysUserNotice(List<SysUserNotice> histories){
        sysUserNoticeDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysUserOrganizeMapper sysUserOrganizeMapper;
    @Autowired
    private SysUserOrganizeDao sysUserOrganizeDao;

    public List<SysUserOrganizeKey> getSysUserOrganize(int pageNo, int pageSize){
        PageInfo<SysUserOrganizeKey> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("UserId,OrganizeCode")
                .doSelectPageInfo(() -> sysUserOrganizeMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysUserOrganize(List<SysUserOrganizeKey> histories){
        sysUserOrganizeDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysUserQueBankMapper sysUserQueBankMapper;
    @Autowired
    private SysUserQueBankDao sysUserQueBankDao;

    public List<SysUserQueBank> getSysUserQueBank(int pageNo, int pageSize){
        PageInfo<SysUserQueBank> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("UserId,QueBankId")
                .doSelectPageInfo(() -> sysUserQueBankMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysUserQueBank(List<SysUserQueBank> histories){
        sysUserQueBankDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysUserRoleMappingMapper sysUserRoleMappingMapper;
    @Autowired
    private SysUserRoleMappingDao sysUserRoleMappingDao;

    public List<SysUserRoleMappingKey> getSysUserRoleMapping(int pageNo, int pageSize){
        PageInfo<SysUserRoleMappingKey> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("UserId,RoleId")
                .doSelectPageInfo(() -> sysUserRoleMappingMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysUserRoleMapping(List<SysUserRoleMappingKey> histories){
        sysUserRoleMappingDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private SysUserStudyMapper sysUserStudyMapper;
    @Autowired
    private SysUserStudyDao sysUserStudyDao;

    public List<SysUserStudy> getSysUserStudy(int pageNo, int pageSize){
        PageInfo<SysUserStudy> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("StudyId")
                .doSelectPageInfo(() -> sysUserStudyMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferSysUserStudy(List<SysUserStudy> histories){
        sysUserStudyDao.batchInsert(histories);
        return histories.size();
    }

    @Autowired
    private TempAnswerHistoryMapper tempAnswerHistoryMapper;
    @Autowired
    private TempAnswerHistoryDao tempAnswerHistoryDao;

    public List<TempAnswerHistory> getTempAnswerHistory(int pageNo, int pageSize){
        PageInfo<TempAnswerHistory> pageInfo = PageHelper.startPage(pageNo,pageSize,false)
                .setOrderBy("TempHistoryId")
                .doSelectPageInfo(() -> tempAnswerHistoryMapper.selectByExample(null));
        return pageInfo.getList();
    }

    @Transactional(rollbackFor = Exception.class)
    public Integer transferTempAnswerHistory(List<TempAnswerHistory> histories){
        tempAnswerHistoryDao.batchInsert(histories);
        return histories.size();
    }
}
